import request from '@/utils/request';

// 平台设置图片新增保存
export async function sitePlatformSettingsSaveImg(data) {
  const res = await request.post('/massage/siteSaveImg', data);
  if (res.data.code === 200) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}

// 平台设置图片新增保存
export async function sitePlatformSettingsSaveList(params) {
  const res = await request.get('/massage/siteSaveImg/page', { params });
  console.log(res);
  if (res.data.code === 200) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.data.message));
}

// 平台设置图片删除
export async function sitePlatformSettingsDelete(id) {
  const res = await request.delete('/massage/siteSaveImg/' + id);
  console.log(res);
  if (res.data.code === 200) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.data.message));
}
